package io.oschina.binv.kapp.framework.utils

import android.util.Log

import io.oschina.binv.kapp.BuildConfig

/**
 * Created by xuybin on 2017/8/31.
 */

class Logger(val tag:String) {
    var DEBUG = BuildConfig.DEBUG

    fun d(value: String) {
        if (DEBUG) {
            Log.d(tag, value)
        }
    }

    fun e(value: String) {
        if (DEBUG) {
            Log.e(tag, value)
        }
    }

    fun e(value: Exception?) {
        if (DEBUG && value != null) {
            Log.e(tag, value.message)
        }
    }

    fun i(value: String) {
        if (DEBUG) {
            Log.i(tag, value)
        }
    }

    fun w(value: String) {
        if (DEBUG) {
            Log.w(tag, value)
        }
    }

    companion object {
        var DEBUG = BuildConfig.DEBUG
    }
}
